//search模块的小仓库
import { reqSearchList } from '@/api'

const actions = {
    async searchList({ commit }, params = {}) {
        let result = await reqSearchList(params)
        commit("SEARCHLIST", result.data)
    }
};

const mutations = {
    SEARCHLIST(state, value) {
        state.searchList = value
    }

}

const state = {
    searchList: {}
}

const getters = {//简化仓库中的数据
    goodlist(state) { //当前仓库state
        return state.searchList.goodsList
    },
    attrsList(state) {
        return state.searchList.attrsList
    },
    trademarkList(state) {
        return state.searchList.trademarkList
    }


}

export default {
    actions,
    mutations,
    state,
    getters
}